<%@ page language="java" pageEncoding="utf-8" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
    <base href="<%=basePath%>">

    <title>${sessionScope.topicName} - 舆情信息系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf8"/>

    <%@include file="im.jsp" %>
    <%--<link rel="stylesheet" href="css/pagination.css"/>--%>
    <link rel="stylesheet" href="css/subPage.css"/>
    <script type="text/javascript" src="js/jquery.min.js"></script>

    <%--<script type="text/javascript" src="js/jquery.pagination.js"></script>--%>
    <link rel="stylesheet" type="text/css" href="css/mypagination.css"/>
    <script type="text/javascript" src="js/mypagination.js"/>
    <link href="js/jquery-ui-1.8.13/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
    <script src="js/jquery-ui-1.8.13/ui/jquery-ui.js"></script>

    <script type="text/javascript">
        $(function () {
            var count = "${result.total}";
            if(count>760){
                count=760;
            }
            var keyword = "${search.keyword}";
            var site = "${search.site}";
            var type = "${search.type}";
            var title = "${search.title}";
            var userTime =${result.useTime};
            var page =${search.page};
            var st =${search.st};
            size = 10; //!!!!!!每页个数！！！！！！
            function pageselectCallback(page_id, jq) {
                //alert(page_id); 回调函数，进一步使用请参阅说明文档
            }

            $("#Pagination").pagination(count, {
                callback: pageselectCallback,//PageCallback() 为翻页调用次函数。
                prev_text: " 上一页",
                next_text: "下一页 ",
                items_per_page: size, //每页的数据个数
                num_display_entries: 3, //两侧首尾分页条目数
                current_page: page,   //当前页码
                num_edge_entries: 2, //连续分页主体部分分页条目数
                link_to: "searchAction.do?method=search&page=__id__" + "&size=" + size + "&keyword=" + keyword + "&title=" + title + "&site=" + site + "&type=" + type + "&st=" + st
            });
        });

    </script>

</head>

<body>
<logic:equal name="user" value="administrator">
<div id="content" class="container">
        <%@include file="top.jsp" %>
    <div class="row">
        <%@include file="left.jsp" %>

        <input type="hidden" name="count" value="200"/>

        <div class="col-md-10">

            <div id="right_left">
                <span> 共耗时 ${result.useTime}s.</span><span>检索到结果 ${result.total}条.</span>

                <div class="titlebox" style="border-bottom: 1px solid darkgray; padding:0 3px;">
                    <div class="title"></div>
                </div>

                <div id="Searchresult">
                    <!-- 标题title -->
                    <logic:present name="result" scope="request">
                        <logic:iterate id="newest" name="result" property="list">
                            <!-- 标题title -->
                            <div class="result" style="border-bottom: 1px dashed #d3d3d3;">
                                <h4 style="display: inline-block;">


                                    <!--输出标题和链接-->
                                    <html:link paramId="link" page="/logAction.do"
                                               paramName="newest" paramProperty="link" target="_blank">
                                        <logic:notEqual name="newest" property="title" value="">
                                            <bean:write name="newest" property="title" filter="false"/>
                                        </logic:notEqual>
                                        <logic:equal name="newest" property="title" value="">暂无标题</logic:equal>
                                    </html:link>
                                        <%--</html:link>--%>
                                </h4>

                                <div>
                                    <!-- 输出类型 -->

                                    <logic:notEqual name="newest" property="dType" value="">
                                        [ <bean:write name="newest" property="dType"></bean:write>]
                                    </logic:notEqual>
                                    <!-- 输出站点 -->

                                    <logic:notEqual name="newest" property="site" value="">
                                        [ <bean:write name="newest" property="site" filter="false"></bean:write>]
                                    </logic:notEqual>

                                    <!-- 输出时间 -->
                                    <logic:notEqual name="newest" property="time" value="">
                                        [<bean:write name="newest"
                                                     property="time"/>]
                                    </logic:notEqual>

                                </div>
                                <!-- 输出摘要 -->
                                <p>
                                    <bean:write name="newest" property="abstext" filter="false"/>
                                </p>
                            </div>

                        </logic:iterate>
                    </logic:present>

                </div>
                <div id="Pagination" class="scott">

                </div>

            </div>

        </div>
    </div>
        <%@ include file="foot.jsp" %>
    </logic:equal>
    <logic:empty name="user">
    Access Rejected! Error 404
    </logic:empty>
</body>
</html>
